import {createI18n} from 'vue-i18n'
import {Locale} from 'vant';
import vantZhLocale from 'vant/es/locale/lang/zh-CN';
import vantUsLocale from 'vant/es/locale/lang/en-US';
import en_ph from "./en_ph";

const locale = localStorage.getItem('locale')
console.log(locale, 'locale')
const i18n = createI18n({
    legacy:false,
    locale: locale || 'en_ph',
    messages: {
        zh_CN:{
        },
        en_ph: {
            ...en_ph,
            ...vantUsLocale
        }
    },

});
const vantLocale = i18n.global.locale.value
if (vantLocale === 'zh_CN') {
    Locale.use('zh_CN', vantZhLocale)
}  else {
    Locale.use('en_ph', vantUsLocale)
}
export default i18n
